package iO;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintWriter;

/**
 * @Author: Miyako
 * @Date: 2024-07-17-10:51
 * @Description: 打印流 实际上还是由字节流实现，用缓冲器和字符流包装了字节流
 */
public class PrintWriterDemo01 {
    public static void main(String[] args) throws FileNotFoundException {
        //PrintWriter pw = new PrintWriter("pw.txt");
        //下方这个构造方法的传参可以自动刷新,而上方需要手动刷新
        PrintWriter pw = new PrintWriter(new FileOutputStream("pw.txt",true),true);
        pw.println("ee");
        pw.println("xx");
        pw.close();
    }
}
